home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIEnvironment.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  152 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIEnvironment.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIEnvironment_h__
  6. #define __gen_nsIEnvironment_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIEnvironment */
  19. #define NS_IENVIRONMENT_IID_STR "101d5941-d820-4e85-a266-9a3469940807"
  20.  
  21. #define NS_IENVIRONMENT_IID \
  22.   {0x101d5941, 0xd820, 0x4e85, \
  23.     { 0xa2, 0x66, 0x9a, 0x34, 0x69, 0x94, 0x08, 0x07 }}
  24.  
  25. /**
  26.  * Scriptable access to the current process environment.
  27.  *
  28.  */
  29. class NS_NO_VTABLE nsIEnvironment : public nsISupports {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IENVIRONMENT_IID)
  33.  
  34.   /**
  35.      * Set the value of an environment variable.
  36.      *
  37.      * @param aName   the variable name to set.
  38.      * @param aValue  the value to set.
  39.      */
  40.   /* void set (in AString aName, in AString aValue); */
  41.   NS_IMETHOD Set(const nsAString & aName, const nsAString & aValue) = 0;
  42.  
  43.   /**
  44.      * Get the value of an environment variable.
  45.      *
  46.      * @param aName   the variable name to retrieve.
  47.      * @return        returns the value of the env variable. An empty string
  48.      *                will be returned when the env variable does not exist or
  49.      *                when the value itself is an empty string - please use
  50.      *                |exists()| to probe whether the env variable exists
  51.      *                or not.
  52.      */
  53.   /* AString get (in AString aName); */
  54.   NS_IMETHOD Get(const nsAString & aName, nsAString & _retval) = 0;
  55.  
  56.   /**
  57.      * Check the existence of an environment variable.
  58.      * This method checks whether an environment variable is present in
  59.      * the environment or not.
  60.      *
  61.      * - For Unix/Linux platforms we follow the Unix definition:
  62.      * An environment variable exists when |getenv()| returns a non-NULL value.
  63.      * An environment variable does not exist when |getenv()| returns NULL.
  64.      * - For non-Unix/Linux platforms we have to fall back to a 
  65.      * "portable" definition (which is incorrect for Unix/Linux!!!!)
  66.      * which simply checks whether the string returned by |Get()| is empty
  67.      * or not.
  68.      *
  69.      * @param aName   the variable name to probe.
  70.      * @return        if the variable has been set, the value returned is
  71.      *                PR_TRUE. If the variable was not defined in the
  72.      *                environment PR_FALSE will be returned.
  73.      */
  74.   /* boolean exists (in AString aName); */
  75.   NS_IMETHOD Exists(const nsAString & aName, PRBool *_retval) = 0;
  76.  
  77. };
  78.  
  79. /* Use this macro when declaring classes that implement this interface. */
  80. #define NS_DECL_NSIENVIRONMENT \
  81.   NS_IMETHOD Set(const nsAString & aName, const nsAString & aValue); \
  82.   NS_IMETHOD Get(const nsAString & aName, nsAString & _retval); \
  83.   NS_IMETHOD Exists(const nsAString & aName, PRBool *_retval); 
  84.  
  85. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  86. #define NS_FORWARD_NSIENVIRONMENT(_to) \
  87.   NS_IMETHOD Set(const nsAString & aName, const nsAString & aValue) { return _to Set(aName, aValue); } \
  88.   NS_IMETHOD Get(const nsAString & aName, nsAString & _retval) { return _to Get(aName, _retval); } \
  89.   NS_IMETHOD Exists(const nsAString & aName, PRBool *_retval) { return _to Exists(aName, _retval); } 
  90.  
  91. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  92. #define NS_FORWARD_SAFE_NSIENVIRONMENT(_to) \
  93.   NS_IMETHOD Set(const nsAString & aName, const nsAString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->Set(aName, aValue); } \
  94.   NS_IMETHOD Get(const nsAString & aName, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Get(aName, _retval); } \
  95.   NS_IMETHOD Exists(const nsAString & aName, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Exists(aName, _retval); } 
  96.  
  97. #if 0
  98. /* Use the code below as a template for the implementation class for this interface. */
  99.  
  100. /* Header file */
  101. class nsEnvironment : public nsIEnvironment
  102. {
  103. public:
  104.   NS_DECL_ISUPPORTS
  105.   NS_DECL_NSIENVIRONMENT
  106.  
  107.   nsEnvironment();
  108.  
  109. private:
  110.   ~nsEnvironment();
  111.  
  112. protected:
  113.   /* additional members */
  114. };
  115.  
  116. /* Implementation file */
  117. NS_IMPL_ISUPPORTS1(nsEnvironment, nsIEnvironment)
  118.  
  119. nsEnvironment::nsEnvironment()
  120. {
  121.   /* member initializers and constructor code */
  122. }
  123.  
  124. nsEnvironment::~nsEnvironment()
  125. {
  126.   /* destructor code */
  127. }
  128.  
  129. /* void set (in AString aName, in AString aValue); */
  130. NS_IMETHODIMP nsEnvironment::Set(const nsAString & aName, const nsAString & aValue)
  131. {
  132.     return NS_ERROR_NOT_IMPLEMENTED;
  133. }
  134.  
  135. /* AString get (in AString aName); */
  136. NS_IMETHODIMP nsEnvironment::Get(const nsAString & aName, nsAString & _retval)
  137. {
  138.     return NS_ERROR_NOT_IMPLEMENTED;
  139. }
  140.  
  141. /* boolean exists (in AString aName); */
  142. NS_IMETHODIMP nsEnvironment::Exists(const nsAString & aName, PRBool *_retval)
  143. {
  144.     return NS_ERROR_NOT_IMPLEMENTED;
  145. }
  146.  
  147. /* End of implementation class template. */
  148. #endif
  149.  
  150.  
  151. #endif /* __gen_nsIEnvironment_h__ */
  152.